# FROM directives are overriden by CI system (both Prow CI and OSBS)
FROM openshift/golang-builder@sha256:4820580c3368f320581eb9e32cf97aeec179a86c5749753a14ed76410a293d83 AS builder
ENV __doozer=update BUILD_RELEASE=202202160023.p0.g5f4c899.assembly.stream BUILD_VERSION=v4.10.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=10 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.10.0-202202160023.p0.g5f4c899.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=5f4c899 OS_GIT_VERSION=4.10.0-202202160023.p0.g5f4c899.assembly.stream-5f4c899 SOURCE_DATE_EPOCH=1639389329 SOURCE_GIT_COMMIT=5f4c89923dcfb1c620490e8ed8de8cd1bdaf5122 SOURCE_GIT_TAG=v0.1.0-141-g5f4c899 SOURCE_GIT_URL=https://github.com/openshift/prom-label-proxy 

WORKDIR /go/src/github.com/openshift/prom-label-proxy
COPY . .
RUN if yum install -y prometheus-promu; then export BUILD_PROMU=false; fi && make build

FROM openshift/base-rhel8:v4.10.0.20220216.010142
ENV __doozer=update BUILD_RELEASE=202202160023.p0.g5f4c899.assembly.stream BUILD_VERSION=v4.10.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=10 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.10.0-202202160023.p0.g5f4c899.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=5f4c899 OS_GIT_VERSION=4.10.0-202202160023.p0.g5f4c899.assembly.stream-5f4c899 SOURCE_DATE_EPOCH=1639389329 SOURCE_GIT_COMMIT=5f4c89923dcfb1c620490e8ed8de8cd1bdaf5122 SOURCE_GIT_TAG=v0.1.0-141-g5f4c899 SOURCE_GIT_URL=https://github.com/openshift/prom-label-proxy 
COPY --from=builder /go/src/github.com/openshift/prom-label-proxy/prom-label-proxy /usr/bin/prom-label-proxy


# doesn't require a root user.
USER 1001
ENTRYPOINT ["/usr/bin/prom-label-proxy"]

LABEL \
        io.k8s.display-name="" \
        io.k8s.description="" \
        io.openshift.tags="prometheus" \
        summary="" \
        maintainer="OpenShift Monitoring Team <team-monitoring@redhat.com>" \
        name="openshift/ose-prom-label-proxy" \
        com.redhat.component="prom-label-proxy-container" \
        io.openshift.maintainer.product="OpenShift Container Platform" \
        io.openshift.maintainer.component="Monitoring" \
        release="202202160023.p0.g5f4c899.assembly.stream" \
        io.openshift.build.commit.id="5f4c89923dcfb1c620490e8ed8de8cd1bdaf5122" \
        io.openshift.build.source-location="https://github.com/openshift/prom-label-proxy" \
        io.openshift.build.commit.url="https://github.com/openshift/prom-label-proxy/commit/5f4c89923dcfb1c620490e8ed8de8cd1bdaf5122" \
        version="v4.10.0"

